var mongoose = require('mongoose');
var Schema = mongoose.Schema;

var LogItemSchema = new Schema({
    md5: {
        type: String,
        index: true
    },
    dateTime: Date,
    level: Number,
    module: String,
    body: String,
    more: Array
});

var AppInfoSchema = new Schema({
    appName: String,
    appId: {
        type: String,
        index: true
    },
    appKey: String,
    logSchemaName: String
});

var UserSchema = new Schema({
    username: {
        type: String,
        index: true
    },
    password: String,
    userType: Number
});

Schema.LogItemSchema = LogItemSchema;
Schema.AppInfoSchema = AppInfoSchema;
Schema.UserSchema = UserSchema;

module.exports = Schema;
